package com.aat.dxfy.iparea;

import java.util.Arrays;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestPress {

	static Logger log = LoggerFactory.getLogger(TestPress.class);
	
	public static void main(String[] args) {
		log.info("start");
		test();
		log.info("end");
	}

	public static void test() {
		int sum = 10000;
		int size = 100;
		ExecutorService pool = Executors.newFixedThreadPool(size);
		int i = 0;
		while (i < sum) {
			pool.submit(new Runnable() {
				@Override
				public void run() {
					int i1 = (int) (Math.random() * 128) + 32;
					int i2 = (int) (Math.random() * 128);
					int i3 = (int) (Math.random() * 128);
					int i4 = (int) (Math.random() * 128);
					String ip = i1 + "." + i2 + "." + i3 + "." + i4;
					String[] ss = GaodeAPI.getCityAndCode(ip);
					System.out.println(Arrays.toString(ss));
				}
			});
			i++;
		}
		pool.shutdown();
	}

}
